package com.example.dingtalkwebproject.controller;

import com.example.dingtalkwebproject.pojo.dArcCompany;
import com.example.dingtalkwebproject.service.dArcCompanyService;
import com.example.dingtalkwebproject.utils.AjaxResult;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Logistics")
public class getAllWlInfoController {


    @Autowired
    private dArcCompanyService dArcCompanyService;


    @GetMapping("/getAllWlCompany")
    public AjaxResult getAllWlInfo() {
        List<dArcCompany> dArcCompanies = dArcCompanyService.selectAllWlCompany();
        if (ObjectUtils.isEmpty(dArcCompanies)) {
            return AjaxResult.error("未获取到当前物流公司!");
        }

        return AjaxResult.success(dArcCompanies);
    }
}
